package person;

public class Interval {
	public static boolean validate(String value) {
		String data[] = value.split(":");
		if (data.length != 2)
			return false;
		try {
			int hh = Integer.parseInt(data[0]);
			int mm = Integer.parseInt(data[1]);
			if (hh < 0 || hh > 24)
				return false;
			if (mm < 0 || mm > 60)
				return false;
		} catch (Exception e) {
			return false;
		}
		return true;
	}

	private String start, end;

	public Interval(String st, String en) {
		start = st;
		end = en;
	}

	public String getEnd() {
		return end;
	}

	public String getStart() {
		return start;
	}

	public void setEnd(String end) {
		this.end = end;
	}

	public void setStart(String start) {
		this.start = start;
	}

	@Override
	public String toString() {
		return start + " " + end;
	}

}
